xen/arm: time: cycles_t should be an uint64_t and not unsigned long
authorJulien Grall <julien.grall@arm.com>
Thu, 20 Jun 2019 17:47:06 +0000 (18:47 +0100)
committerStefano Stabellini <sstabellini@kernel.org>
Fri, 21 Jun 2019 00:00:13 +0000 (17:00 -0700)
commitd9086e8ee06b9201dd135e1374066fba9682c0c2
tree0f4abbe55036dd38215a886a514e63639f7e7943
parenta3014dfc84fa5893e3bb5b5280ef934bae9637b3
xen/arm: time: cycles_t should be an uint64_t and not unsigned long

Since commit ca73ac8e7d "xen/arm: Add an isb() before reading CNTPCT_EL0
to prevent re-ordering", get_cycles() is now returning the number of
cycles and used in more callers.

While the counter registers is always 64-bit, get_cycles() will only
reutrn a 32-bit on Arm32 and therefore truncate the value. This will
result to weird behavior by both Xen and the Guest as the timer will not
be setup correctly.

This could be resolved by switch cycles_t from unsigned long to
unsigned int.

This change was originally introduced by
da3d55ae67225798c2ad8f42af2f432f6f2b2214 "console: avoid printing no or
null time stamps".

Signed-off-by: Julien Grall <julien.grall@arm.com>
[Stefano: improve commit message]
Signed-off-by: Stefano Stabellini <stefanos@xilinx.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/include/asm-arm/time.h